<?php
		session_start();
		session_destroy();
		foreach ($_COOKIE as $key=>$value)
		{
			setcookie ($key, "", time() - 3600);
		}

		$phone = '';

		if(!empty($_GET['autophone']))
		{
			include 'config.php';
			$row = mysql_query('select * from mobile_phone limit 1');
			$row = mysql_fetch_assoc($row);
			$phone = $row['phone'];
			mysql_query('delete from mobile_phone where id='.$row['id']);
		}

?>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
需要充值的号码：<input type="text" id="phone" value="<?php echo $phone?>">
<input type=button value="提交" onclick="location.href='./?phone='+document.getElementById('phone').value">
<input type="button" value="自动导入号码" onclick="location.href='./?autophone=1'">
<div id="mobileInfo">
<?php
	if(!empty($_GET['phone']))
	{		
		$url = 'http://epay.uc.cn/index.php?do=mobile_input&uc_param_str=nidnbifrvepfip';
		$ch = curl_init();
		curl_setopt($ch,CURLOPT_URL,$url);
		curl_setopt($ch, CURLOPT_HEADER, false);
		curl_setopt($ch, CURLOPT_POST,1) ;
		$data = 'mobile_num='.$_GET['phone'].'&amount=30&payer_id=2001';
		curl_setopt($ch, CURLOPT_POSTFIELDS,$data) ;
		curl_exec($ch);
		curl_close($ch);
?>

</div>
<hr>
<?php echo $_GET['phone']; ?>
<hr>
<script>
	mobileInfo = document.getElementById("mobileInfo").innerHTML;
	mobileInfo = eval('('+mobileInfo+')');
	document.write('<embed type="application/x-unionpayplugin" uc_plugin_id="unionpay" height="80" width="250" class="img1" noinstallpic="http://epay.uc.cn/img/html5/mobile/unionpay_not_install.png?v=120727" paydata="'+mobileInfo.data.pay_params+'"></embed>');
</script>

<?php
	}	
?>